<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "https://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-CN"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="Content-Language" content="zh-CN"><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css">
<title>SPI_returntuple</title>
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head><body class="REFENTRY">
<div>
<table summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><th colspan="5" align="center" valign="bottom">PostgreSQL 8.2.3 中文文档</th></tr>
<tr><td width="10%" align="left" valign="top"><a href="spi-spi-copytuple.html" accesskey="P">后退</a></td><td width="10%" align="left" valign="top"><a href="spi-spi-copytuple.html">快退</a></td><td width="60%" align="center" valign="bottom"></td><td width="10%" align="right" valign="top"><a href="spi-spi-modifytuple.html">快进</a></td><td width="10%" align="right" valign="top"><a href="spi-spi-modifytuple.html" accesskey="N">前进</a></td></tr>
</table>
<hr align="LEFT" width="100%"></div>
<h1><a name="SPI-SPI-RETURNTUPLE"></a>SPI_returntuple</h1>
<div class="REFNAMEDIV"><a name="AEN43306"></a><h2>函数名</h2>SPI_returntuple&nbsp;--&nbsp;准备把一个行当作 Datum 返回</div>
<a name="AEN43309"></a>
<div class="REFSYNOPSISDIV"><a name="AEN43311"></a><h2>原型</h2>
<pre class="SYNOPSIS">HeapTupleHeader SPI_returntuple(HeapTuple <tt class="PARAMETER">row</tt>, TupleDesc <tt class="PARAMETER">rowdesc</tt>)</pre>
</div>
<div class="REFSECT1"><a name="AEN43315"></a><h2>描述</h2>
<p><code class="FUNCTION">SPI_returntuple</code> 在上层执行者环境里制作一个行的拷贝，并且把它以行类型 <tt class="TYPE">Datum</tt> 的形式返回。所返回的指针在返回之前只需要用 <code class="FUNCTION">PointerGetDatum</code> 转换成 <tt class="TYPE">Datum</tt></p>
<p>请注意这个函数应该只用于那些声明为返回复合类型的函数。它不用于触发器；用 <code class="FUNCTION">SPI_copytuple</code> 在触发器中返回一个修改过的行。</p>
</div>
<div class="REFSECT1"><a name="AEN43324"></a><h2>参数</h2>
<div class="VARIABLELIST">
<dl>
<dt><tt class="LITERAL">HeapTuple <tt class="PARAMETER">row</tt></tt></dt>
<dd><p>将要被拷贝的行</p></dd>
<dt><tt class="LITERAL">TupleDesc <tt class="PARAMETER">rowdesc</tt></tt></dt>
<dd><p>行的描述符(每次都传递同样的描述符可以获取最高缓冲效率)</p></dd>
</dl>
</div>
</div>
<div class="REFSECT1"><a name="AEN43339"></a><h2>返回值</h2>
<p>指向拷贝出来的行的 <tt class="TYPE">HeapTupleHeader</tt> ；只有在 <tt class="PARAMETER">row</tt> 或 <tt class="PARAMETER">rowdesc</tt> 是 <tt class="SYMBOL">NULL</tt> 的时候才返回 <tt class="SYMBOL">NULL</tt></p>
</div>
<div>
<hr align="LEFT" width="100%">
<table summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td width="33%" align="left" valign="top"><a href="spi-spi-copytuple.html" accesskey="P">后退</a></td><td width="34%" align="center" valign="top"><a href="index.html" accesskey="H">首页</a></td><td width="33%" align="right" valign="top"><a href="spi-spi-modifytuple.html" accesskey="N">前进</a></td></tr>
<tr><td width="33%" align="left" valign="top">SPI_copytuple</td><td width="34%" align="center" valign="top"><a href="spi-memory.html" accesskey="U">上一级</a></td><td width="33%" align="right" valign="top">SPI_modifytuple</td></tr>
</table>
</div>
</body></html>